package io.github.xbeeant.eoffice.config.security;

import io.github.xbeeant.spring.security.handler.AuthenticationFailedHandler;
import org.springframework.security.core.AuthenticationException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author xiaobiao
 * @version 2021/6/30
 */
public class AuthenticationFailureHandlerExt extends AuthenticationFailedHandler {
    @Override
    public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {
//        ILoginLogService loginLogService = AppContextUtil.getBean(ILoginLogService.class);
//         todo username
//        loginLogService.loginFailed(Requests.getIp(request), "username", null, request.getHeader("user-agent"));
        super.onAuthenticationFailure(request, response, exception);
    }
}

